#pragma once

#include "ui_render.h"
#include "ui_offset_dc.h"

_SSL_BEGIN
_SSUIL_BEGIN

class UIGdiRenderUtil
{
public:
	static void DrawColor(HDC dc, const UIRect &dest_rt, unsigned long color);
	static void DrawFrame(HDC dc, const UIRect &dest_rt, unsigned long color);

	static void DrawText(HDC dc, const tchar *text, int text_len,
		unsigned long text_color, const UIRect *rt, HFONT font, unsigned int style,
		bool transparent, unsigned long bk_color = 0);
	static bool MeasureTextSize(const tchar *text, int text_len,
		ss_inout_ UIRect &rt, HFONT font, UIMeasureTextType measure_type);

protected:
	static HDC AlphaDrawPre(UIOffScreenDC &dc, const UIRect &rt, HDC dc_ori);
	static void AlphaDrawPost(UIOffScreenDC &dc, const UIRect &rt, HDC dc_h, int alpha_value);

	static void DrawTextInternal(HDC dc, const tchar *text, int text_len,
		unsigned long text_color, const UIRect *rt, HFONT font, unsigned int style,
		bool transparent, unsigned long bk_color = 0);
	static void DrawColorInternal(HDC dc, const UIRect &dest_rt, unsigned long color);
	static void DrawFrameInternal(HDC dc, const UIRect &dest_rt, unsigned long color);
};

_SSUIL_END
_SSL_END

